package com.mall.common.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author xyl
 * @date 2021-02-16 17:54
 */
public class ServletUtil {

    static ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();

    public static HttpServletRequest getRequest(){
        return servletRequestAttributes.getRequest();
    }
    public static HttpServletResponse getResponse(){
        return servletRequestAttributes.getResponse();
    }


}
